<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<!-- 
<script language="javascript">
function upload()
// hide old iframe
var par = window.parent.document;

// add image progress
var images = par.getElementById('imageGift');
var d = document.getElementById("provaimg"); 
//d.setAttribute("src", "uploads/"+images.value);

alert(images.value);

</script> 
-->


<!--<div id="formaddgift">-->
<p id="msg"></p>
<!--<form method="post" enctype="multipart/form-data">-->
<!-- <form id="formaddgift" method="post" enctype="multipart/form-data" class="control" action="" >  -->
<html:form method="post" styleClass="control" action="/AddGift" enctype="multipart/form-data">
	<fieldset><label> <bean:message key="AddGift.label"/> </label><br />
	<label> ITA </label>
	<table>
		<tr><td></td><td> <html:errors property="name" /></td></tr>
		<tr>
			<td><label> <bean:message key="AddGiftForm.name"/> </label></td>
			<td><!-- <input class="textfieldadmin" type="text" name="nameita" id="nameGiftIta" />-->
			<!-- <input class="required"  name="nameita" id="nameGiftIta" /> -->
			<html:text styleClass="textfieldadmin" property="name" /></td>
			<td>
		</tr>
		<tr><td></td><td> <html:errors property="descrizione" /></td></tr>
		<tr>
			<td><label> <bean:message key="AddGiftForm.description"/> </label></td>
			<td><html:textarea styleClass="textfieldadmin" style="width:100%"
				property="descrizione" /></td>
		</tr>
	</table>
	</fieldset>
	<fieldset id="formgift">
	<table>
		<tr><td></td><td> <html:errors property="link" /></td></tr>
		<tr>
			<td><label> <bean:message key="AddGiftForm.link"/> </label></td>
			<td><!--<input class="textfieldadmin" name="link" id="linkGift" />-->
			<!-- <input class="required" name="link" id="linkGift" /> --> <html:text
				styleClass="textfieldadmin" property="link" /></td>
		</tr>
		<tr><td></td><td> <html:errors property="linkname" /></td></tr>
		<tr>
			<td><label> <bean:message key="AddGiftForm.linkname"/> </label></td>
			<td><!--<input class="textfieldadmin" name="linkname" id="linkGiftName" />-->
			<!-- <input class="required" name="linkname" id="linkGiftName"  />  -->
			<html:text styleClass="textfieldadmin" property="linkname" /></td>
		</tr>
		<tr><td></td><td> <html:errors property="price" /></td></tr>
		<tr>
			<td><label> <bean:message key="AddGiftForm.price"/> </label></td>
			<td><!--<input class="textfieldadmin" name="price" id="price" />-->
			<!-- <input class="required" name="price" id="price" />  --> <html:text
				styleClass="textfieldadmin" property="price" /></td>
		</tr>
		<tr><td></td><td> <html:errors property="category" /></td></tr>
		<tr>
		<td><label> <bean:message key="AddGiftForm.category"/> </label></td>
		<td>
			<html:select styleClass="textfieldadmin"  property="categoryList">
				<c:forEach var = "categoryListElement" items = "${requestScope.categoryList}">
					<html:option value="${categoryListElement.id}">${categoryListElement.name}</html:option>
				</c:forEach>
			</html:select>		
		</td>
		</tr>
		<tr>

		</tr>
		<tr><td></td><td> <html:errors property="uploadedfile" /></td></tr>
		<tr>
			<td><label><bean:message key="AddGiftForm.uploadedfile"/> </label></td>
			<td><!-- 	<input type="hidden" name="MAX_FILE_SIZE" value="100000"  />-->
			<!-- <input class="textfieldadmin" name="uploadedfile" type="file" id="imageGift" onchange="upload()"  />-->
			<!--<html:file styleClass="textfieldadmin" property="uploadedfile" onchange="upload()"/>-->
			<html:file property="uploadedfile" /> <img src="" id="provaimg" /></td>
		</tr>
		<tr>
			<td><!-- <input type="hidden" value="addgift" name="ajaxattempt" id="hiddenGift"/>-->
			<!-- <input type="hidden" value="addgiftAdm" name="manageGift" id="hiddenGift"/> -->
			<!-- <input type="submit" value="Add" id="submitGift" class="control" /> -->
			<html:submit styleClass="control" value="Add" /></td>




		</tr>
	</table>
	</fieldset>
</html:form>
<!--</div>-->
